from stores.TCStore import TCStore
from stores.MemStore import MemStore
import unittest

class TCStoreTester(unittest.TestCase):
        
    def setUp(self):
        self._db = TCStore(filename='/tmp/sowarnaStore.tc', type=TCStore.BTREE)
    def tearDown(self):
        pass
    
    def testBasicOperations(self):
        self._db.put("Ahmed", "Soliman")
        self.assertEquals(self._db.get("Ahmed"), "Soliman")


class MemStoreTester(unittest.TestCase):
    def setUp(self):
        self._db = MemStore()
    def tearDown(self):
        pass
    
    def testPutGet(self):
        self._db.put("Ahmed", "Soliman")
        self.assertEquals(self._db.get("Ahmed"), "Soliman")